#pragma once
#include<stdbool.h>
typedef struct TreeNode{
	struct TreeNode* lchild, *rchild;
	int data;
}TreeNode, *Tree;

typedef struct Queue
{
	TreeNode* data[20];
	int front, rear;
}Queue;

void InitQueue(Queue* q)
{
	q->front = q->rear = -1;
}

void EnQueue(Queue* q, TreeNode* t)
{
	q->data[++q->rear] = t;
}

TreeNode* DeQueue(Queue* q)
{
	return q->data[++q->front];
}

bool IsEmptyQ(Queue* q)
{
	return q->front == q->rear;
}

typedef struct {
	int data[100];
	int top;
}Stack;

void InitStack(Stack* s)
{
	s->top = -1;
}

void Push(Stack* s, int data)
{
	s->data[++s->top] = data;
}

int Pop(Stack* s)
{
	return s->data[s->top--];
}

bool IsEmpty(Stack* s)
{
	return s->top == -1;
}



